stylecontext: fix a StyleData refleak
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 13 Sep 2012 17:48:43 +0000 (13:48 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 13 Sep 2012 21:00:20 +0000 (17:00 -0400)
We were failing to unref the style data in some code paths.

https://bugzilla.gnome.org/show_bug.cgi?id=683627

gtk/gtkstylecontext.c

index 0b3cf04867478ff7bb261f41d4a4683715dd5d82..63ac1defaa982e52c787bf07b225da1b3ba335c7 100644 (file)
@@ -3169,8 +3169,6 @@ _gtk_style_context_validate (GtkStyleContext  *context,
           data = style_data_lookup (context);
 
           changes = _gtk_css_computed_values_get_difference (data->store, current->store);
-
-          style_data_unref (current);
         }
       else
         {
@@ -3190,6 +3188,9 @@ _gtk_style_context_validate (GtkStyleContext  *context,
       gtk_style_context_update_cache (context, parent_changes);
     }
 
+  if (current)
+    style_data_unref (current);
+
   if (change & GTK_CSS_CHANGE_ANIMATE &&
       gtk_style_context_is_animating (context))
     {